<style lang="less" scoped src="./teacherschedule.less"></style>
<script src="./teacherschedule.js"></script>

<template>
    <div>
        <Row style="font-size: 15px;">
            <Col span="24">
            教师：
            <Input v-model="query.teacherName" clearable style="width: 15%"></Input>
            班级：
            <Input v-model="query.className" clearable style="width: 15%"></Input>
            状态：
            <Select v-model="query.status" style="width:10%" filterable clearable>
                <Option :value='1'>未上</Option>
                <Option :value='2'>正常</Option>
                <Option :value='3'>请假</Option>
                <Option :value='4'>迟到</Option>
            </Select>
            机构：
            <Input v-model="query.departmentName"  :readonly="true" style="width: 17%"  @on-click="deptModal = true" icon="search"></Input>
            </Col>
        </Row>
        <Row style="font-size: 15px;;margin-top: 5px">
            <Col span="22">
            <span @click="loadList"><Button type="primary" icon="android-search">查询</Button></span>
            <span @click="refresh"><Button type="primary" icon="refresh">清空</Button></span>
            </Col>
        </Row>
        <div class="main-table">
            <Table border :columns="columns" :data="data"></Table>
        </div>
        <div class="pagination">
            <Page :total="total" size="small" :page-size="pageSize" :current.sync="pageIndex" @on-change="loadList"
                  show-total show-elevator></Page>
        </div>
        <Modal
                v-model="viewModal"
                :title="editTitle"
                :mask-closable="isRead"
                :closable="isRead"
                width="80%">
            <Row class="table-Row">
                <Col span="4" class="titele"><span style="color: red" >*</span>姓名：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.name" :clearable="!isRead" :readonly="isRead" ></Input>
                </Col>
                <Col span="4" class="titele"><span style="color: red" >*</span>手机：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.cellphone" :clearable="!isRead" :readonly="isRead"  ></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">身份证号：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.cardId" :clearable="!isRead" :readonly="isRead" ></Input>
                </Col>
                <Col span="4" class="titele"><span style="color: red">*</span>任职部门：</Col>
                <Col span="8" class="content">
                <Input  :readonly="true" :icon="isRead ? '': 'search'" v-model="formData.orgname"  @on-click="orgModal=true"></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">学历：</Col>
                <Col span="8" class="content">
                <Select v-model="formData.educationid" :clearable="!isRead" :disabled="isRead">
                    <Option v-for="item in learnList" :value="item.id" :key="item.id">{{item.name}}</Option>
                </Select>
                </Col>
                <Col span="4" class="titele">职称：</Col>
                <Col span="8" class="content">
                <Select v-model="formData.technicalid" :clearable="!isRead" :disabled="isRead" >
                    <Option v-for="item in positionList" :value="item.id" :key="item.id">{{item.name}}</Option>
                </Select>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele"><span style="color: red">*</span>教师类型：</Col>
                <Col span="8" class="content">
                <Select v-model="formData.teachertypeid" :clearable="!isRead" :disabled="isRead">
                    <Option v-for="item in teachertypeList" :value="item.id" :key="item.id">{{item.name}}</Option>
                </Select>
                </Col>
                <Col span="4" class="titele"><span style="color: red">*</span>专业：</Col>
                <Col span="8" class="content">
                <Input  :readonly="true" :icon="isRead ? '': 'search'" v-model="formData.majorsname"  @on-click="initMajorTree()"></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">出生日期：</Col>
                <Col span="8" class="content">
                <DatePicker v-model="formData.birthday" :clearable="!isRead" :readonly="isRead" :editable="false" style="width: 100%"></DatePicker>
                </Col>
                <Col span="4" class="titele">从教日期：</Col>
                <Col span="8" class="content">
                <DatePicker v-model="formData.teachtime" :clearable="!isRead" :readonly="isRead" :editable="false" style="width: 100%"></DatePicker>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">性别：</Col>
                <Col span="8" class="content">
                <Select v-model="formData.gender" :clearable="!isRead" :disabled="isRead">
                    <Option v-for="item in sexList" :value="item.id" :key="item.id">{{item.name}}</Option>
                </Select>
                </Col>
                <Col span="4" class="titele">邮箱：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.emial" :readonly="isRead" ></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">家庭电话：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.homeTelephone" :readonly="isRead" ></Input>
                </Col>
                <Col span="4" class="titele">单位电话：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.workTelephone" :readonly="isRead"></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">信用卡名称：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.creditname" :readonly="isRead" ></Input>
                </Col>
                <Col span="4" class="titele">信用卡号：</Col>
                <Col span="8" class="content">
                <Input v-model="formData.creditno" :readonly="isRead" ></Input>
                </Col>
            </Row>
            <Row class="table-Row">
                <Col span="4" class="titele">家庭地址：</Col>
                <Col span="8" class="content">
                <Input type="textarea" v-model="formData.address" :readonly="isRead" ></Input>
                </Col>
                <Col span="4" class="titele">教师简介：</Col>
                <Col span="8" class="content">
                <Input type="textarea" v-model="formData.intro" :readonly="isRead" ></Input>
                </Col>
            </Row>
        </Modal>
        <Modal v-model="deptModal"
               title="部门列表"
               width="20%"
               :mask-closable="false">
            <custom-tree ref="dept"
                         url="/base/organize/findOrgAll"
                         :formData="{'orgid': baseuser.orgId}"
                         :showCheckbox="false"></custom-tree>
            <div slot="footer">
                <Button type="primary" @click="setDept">确认</Button>
                <Button type="error" style="margin-left: 8px" @click="cancelSelect">清空</Button>
            </div>
        </Modal>
    </div>
</template>